#include<string.h>
#include<errno.h>
#include"Socket.hpp"
#include"../Channel/Channel.hpp"
#include"../Log/log.hpp"

int main()
{
    Socket socket;
    socket.CreateClient(std::string("127.0.0.1"), 8888);

    int i = 5;
    while(i--)
    {
        std::string str("你是谁");
        socket.Send(str.c_str(), str.size());

        char buf[1024] = {0};
        socket.Recv(buf, 1023);

        std::cout << buf << std::endl;
        if(i == 0)  break;
        sleep(1);
    }
   
    while(1) sleep(1);
    socket.Close();
    return 0;
}